package org.contact.service.impl;

import java.util.List;
import java.util.Map;

import org.contact.dao.ContactDAO;
import org.contact.model.dto.ContactoDTO;
import org.contact.service.ContactService;

public class ContactServiceImpl implements ContactService {
	
	private ContactDAO contactDAO;
	public void setContactDAO(ContactDAO contactDAO) {
		this.contactDAO = contactDAO;
	}

	@Override
	public void actualizar(ContactoDTO t) {
		contactDAO.update(t);
	}

	@Override
	public void eliminar(ContactoDTO t) {
		contactDAO.delete(t);
	}

	@Override
	public Long insertar(ContactoDTO t) {
		return contactDAO.insert(t);
	}

	@Override
	public List<ContactoDTO> listarTodos(Map<String, String> filter) {
		return contactDAO.loadAll(filter);
	}

	@Override
	public ContactoDTO obtenetXId(ContactoDTO t) {
		return contactDAO.getById(t);
	}

}
